products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]]
print("-------商品列表------")
for i in range(6):
    if i < 2:
        print("{}\t{}".format(products[i][0],products[i][1]))
    elif i == 2:
        print("{}\t{:>7}".format(products[i][0],products[i][1]))
    elif i > 2 and i < 5:
        print("{}\t{:^7}".format(products[i][0],products[i][1]))
    else:
        print("{}\t{:>6}".format(products[i][0],products[i][1]))
shop_car = []
shop_cost= []
while True:
    goods =input("plese input the goods you need:")
    if goods == 'q':
        print(shop_car)
        break
    else:
        for x in products:
            if goods == x[0]:
                shop_car.append(x[0])
                shop_cost.append(x[1])
                break
        else:
            print("sorry,we don't have {},plese input other goods".format(goods))

# 整个逻辑上没有什么问题，不过要注意下：
# 1 更好的话，最好加个商品序号，比如：1，2，3，4，5 用户输入序号就能购买对应的商品
# 2 可以的话，希望能告诉用户如何友好的退出这个程序